// 导入 express 模块
import express from "express";
import cors from "cors";
import getDataMiddleWare from "./middleware.js";

console.log("getDataMiddleWare", getDataMiddleWare);
// 定义端口号
const PORT = 9898;

// 创建 express 应用
const app = express();

app.use(cors()); //解决跨域

// app.get("*", getDataMiddleWare);
// app.post("*", getDataMiddleWare);
app.all("*", getDataMiddleWare);

// 启动服务器
app.listen(PORT, () => {
  console.log(`Server is running on http://localhost:${PORT}`);
});
